<%-- 
    Document   : updateCustomer
    Created on : 23 Nov, 2012, 12:17:25 PM
    Author     : sagar
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="../common/script.jsp" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%@include file="../common/title.jsp" %>
        <script type="text/javascript">
            $(function() {
                $( "#followupDate" ).datetimepicker({dateFormat: 'yy-mm-dd',stepMinute:15, hourMin:8,hourMax:21,minDate:0});
                $( "#dateOfBirth1" ).datepicker({dateFormat: 'yy-mm-dd',changeMonth:'true',changeYear:'true',yearRange:'1930:+0'});
                $( "#dateOfJoining1").datepicker({dateFormat: 'yy-mm-dd',changeMonth:'true',changeYear:'true',yearRange:'1950:+0'});
            });
        </script>

        <script type="text/javascript">
            var illnessFlag=0;
            var rules=new Array();
            rules[0]='paymentTypeId.paymentTypeId|required|please Select customer Type';
            rules[1]='relation.relationId|required|please Select Relation';
            rules[2]='age|mask|0123456789';
            rules[3]='age|maxlength|3|maximum 3 digits are allowed';
            rules[4]='callType.callTypeId|required|please Select CallType';
            rules[5]='dispositionId|required|please Select Disposition';
            rules[6]='phone1|maxlength|10|please enter only 10 digit no';
            rules[7]='phone1|mask|0123456789';
            rules[8]='phone2|maxlength|10|please enter only 10 digit no';
            rules[9]='phone2|mask|0123456789';
            rules[10]='bloodGroup|required|please select blood group';
            rules[11]='emailId|email|email must be a valid e-mail.';
            rules[12]='empId|maxlength|6|maximum 6 digits are allowed';
            rules[13]='officeLocation.officeId|required|please select office location';
            rules[14]='healthSpringCenter.centerId|required|please select center';
            rules[15]='zipCodeArea.zipCode|mask|0123456789';
            rules[16]='zipCodeArea.zipCode|maxlength|6|maximum 6 digits are allowed';
            rules[17]='gender|required|please select gender';
            rules[18]='food|custom|checkBlankFields()';
            rules[19]='drug|custom|checkBlankFields()';
            rules[20]='otherAllergies|custom|checkBlankFields()';
            rules[21]='final_tiers|custom|checkBlankFields()';
            rules[22]='otherIlness|custom|checkBlankFields()';
            rules[23]='followupDate|custom|followupDate1()';
            rules[24]='recordingId|required|please enter call recording id';
            rules[25]='transNotes|required|please enter notes';
            //            function  updateAge() {
            //                document.getElementById('age').value=getAge(document.getElementById('dateOfBirth1').value);
            //            }
            
            
            //Start //Show ZipCode
            function showZipCode(){
                var zipCode=document.getElementById("zipCodeArea.zipCode").value;
                //alert("inside showZipCode value of zip :"+zipCode);
                $.ajax({
                    data: ({'zipCode1' : zipCode}),
                    url: "../getZipCodeArea.htm",
                    dataType: "json",
                    success:function(json){
                        if(json!=null){
                            //alert("json area: "+json);
                            document.getElementById("area").value=json.area;
                            document.getElementById("masterZone").value=json.masterZone.masterZoneCode;
                            //document.getElementById("zipCodeId").value=json.zipCodeId;
                        }else{
                            document.getElementById("area").value='N/A';
                            document.getElementById("masterZone").value='N/A';
                        }
                    },
                    error: function(e){
                        
                        alert("Error:  Please Enter Zipcode ");
                    }
                });
            }
            //End //Show ZipCode
            
            
            //FOR DISPOSITION LIST
            function showDispositionList(){
                var callTypeId=document.getElementById("callType.callTypeId").value;
                //alert("insideshowDispositionList value of callTypeId :"+callTypeId);
                $.ajax({
                    data: ({'callTypeId1' : callTypeId}),
                    url: "../ajaxCallForDispositionList.htm",
                    dataType: "json",
                    success:function(json){
                        //alert('inside success event');
                        var i=0;
                        document.getElementById("dispositionId").length=0;
                        
                        var anOption1=document.createElement("OPTION");
                        document.form1.dispositionId.options.add(anOption1);
                        anOption1.text="-";
                        anOption1.value="";
                        for(i=0;i<json.length;i++){
                            //alert('inside if ');
                            var anOption=document.createElement("OPTION");
                            document.form1.dispositionId.options.add(anOption);
                            //alert('anOption.text: '+anOption.text);
                            anOption.text=json[i].label;
                            anOption.value=json[i].value;
                        }
                    },
                    error: function(e){
                        
                        alert("Error:  method not called ");
                    }
                });
            }
            //End
             
            function followupDate1(){
                var flag=0;
                var e = document.getElementById("dispositionId");
                var selectedDisposition = e.options[e.selectedIndex].value;
                //alert("selectedDisposition"+selectedDisposition);
               
            <c:forEach items="${dispositionList}" var="dispositionItem">
                    
                    
                    if(selectedDisposition==${dispositionItem.dispositionId}
                        && ${dispositionItem.followupRequired=='true' }){
                        var flDate = document.getElementById("followupDate").value;
                        if(flDate==""){
                            //alert("flag=1");
                            flag=1;
                        }
                    }
                
          
            </c:forEach>
                    //alert("outside of c for each"+flag);
                    if(flag==1){
                        return 'followupDate required';
                    }else{
                        
                        return null;
                    }
                    
                
                }
        </script>
        <script type="text/javascript">
            $(function() {
                $( "#hospitalId" ).autocomplete({
                    source: "../ajaxCallForHospitalList.htm",
                    minLength: 1    
                });
            });
        </script>

        <script type="text/javascript">
            $(function() {
                $( "#appSpecialistId" ).autocomplete({
                    source: "../ajaxCallForAppSpecialist.htm",
                    minLength: 1    
                });
            });
        </script>
        <script type="text/javaScript">
    
            function addOption(selectbox,text,value) {
                var optn = document.createElement("OPTION");
                optn.text = text;
                optn.value = value;
                selectbox.options.add(optn);
            }
    
            function moveRight(){
               
                var rightBox=document.form1.final_tiers;
                var leftBox=document.form1.left_out;
                var moved=0;
                for (var i=0; i<leftBox.length+moved; i++) {
                    if (leftBox.options[i-moved].selected == true) {
                        addOption(rightBox,leftBox.options[i-moved].text,leftBox.options[i-moved].value);
                        leftBox.remove(i-moved);
                        moved++;
                    }
                }
            }
            function moveLeft(){
               
                var rightBox=document.form1.final_tiers;
                var leftBox=document.form1.left_out;
                var moved=0;
                for (var i=0; i<rightBox.length+moved; i++) {
                    if (rightBox.options[i-moved].selected == true) {
                        addOption(leftBox,rightBox.options[i-moved].text,rightBox.options[i-moved].value);
                        rightBox.remove(i-moved);
                        moved++;
                    }
                }
            }
    
            function validateForm()
            {
               
                var rightBox=document.form1.final_tiers;
              
                var viewTiers="";
               
                document.form1.selectedIllnessIds.value="";
                for (var i=0; i<rightBox.length; i++) {
                    //alert('rightBox.options[i].value'+rightBox.options[i].value);
                    viewTiers += rightBox.options[i].value + ",";
                    //alert('viewTiers'+viewTiers);
                }
                viewTiers = viewTiers.substr(0, (viewTiers.length-1));
                document.form1.selectedIllnessIds.value=viewTiers;
                
                return true;
            }
            //            
            //            function  updateAge() {
            //                document.getElementById('age').value=getAge(document.getElementById('dateOfBirth1').value);
            //            }
            function checkBlankFields() {
                //alert("inside checkForBlank()");
                
                if(illnessFlag==0) {
                    //alert("("+document.getElementById("food").value+")");
                    if(document.getElementById("food").value=="" || document.getElementById("drug").value=="" || document.getElementById("otherAllergies").value==""  ) {
                        //alert("inside food");
                        illnessFlag=1;
                        return " Warning.You have not selected Alergies.";
                    } else if (document.getElementById("final_tiers").value=="" || document.getElementById("otherIllness").value=="") {
                        
                        //alert("inside 2");
                        illnessFlag=1;
                        return " Warning.You have not selected  Known Illnesses.";
                        //return null;
                    }
                    else{
                        return null;
                    }
                } else {
                    return null;
                }
            }
        </script>
    </head>
    <body onLoad="yav.init('form1',rules,'inline');">
        <%@include file="../common/header.jsp" %>
        <%@include file="../common/menu.jsp" %>
        <c:choose>
            <c:when test="${customer.important=='true'}">
                <c:set var="color" value="in_02_imp"/>
            </c:when>
            <c:otherwise>
                <c:set var="color" value="in_02"/>
            </c:otherwise>
        </c:choose>
        <div class="${color}">
            <table style="width: 100%;">
                <tbody>
                    <tr>
                        <td style=" width: 50%;">
                            <%@include file="../common/message.jsp" %>

                            <div class="update_customer_form">
                                <form:form id="form1" name="form1" modelAttribute="customer" method="POST" cssClass="userInputForm">
                                    <sec:authorize ifAnyGranted="ROLE_BF_SEND_SMS">

                                        <%-- <a href="javascript:void(0);" onclick="window.open('../sms/updateCustomerForSms.htm?customerId=<c:out value="${customer.customerId}"/>','_blank','status=0, toolbar=0, location=0, menubar=0, directories=0, resizable=1, scrollbars=1, width=1000, height=550');return false;">Send SMS</a>--%>
                                    </sec:authorize>
                                    <fieldset style="width: 100%;">
                                        <legend><spring:message code="title.customerDetails"/> for Customer Id - ${customer.customerId}</legend>
                                        <table class="formTable">
                                            <tr>
                                                <td>
                                                    <a  href="../sms/updateCustomerForSms.htm?customerId=<c:out value="${customer.customerId}"/>">Send SMS</a>
                                                    &nbsp;&nbsp;&nbsp;<a  href="../email/selectEmailTemplate.htm?customerId=<c:out value="${customer.customerId}"/>">Send Email</a> 

                                                    <fieldset>
                                                        <legend>Customer Info</legend>
                                                        <table class="formTable1">

                                                            <tr>
                                                                <td><spring:message code="patientName"/>:<br/><form:input path="customerName" cssClass="userInputLarge"/></td>  
                                                                <td>
                                                                    <spring:message code="activeForCustomer"/>:<br/>
                                                                    <form:radiobutton cssClass="gender" path="active" value="true" cssStyle="margin:0 -20px 0 0;" /><spring:message code="yes"/>&nbsp;
                                                                    <form:radiobutton cssClass="gender" path="active" value="false" cssStyle="margin:0 -20px 0 0;" /><spring:message code="no"/>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td><spring:message code="important"/>:<br/>
                                                                    <form:radiobutton cssClass="gender" path="important" value="true" cssStyle="margin:0 -20px 0 0;" /><spring:message code="yes"/>&nbsp;
                                                                    <form:radiobutton cssClass="gender" path="important" value="false" cssStyle="margin:0 -20px 0 0;" /><spring:message code="no"/>
                                                                </td>
                                                                <td colspan="2"><spring:message code="remainInContactVia"/>:<br/>
                                                                    <form:checkbox path="sms" value="true" label="Sms" cssStyle="margin:0 -20px 0 0;"></form:checkbox>
                                                                    <form:checkbox path="email" value="true" label="Email" cssStyle="margin:0 -20px 0 0;"></form:checkbox>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td><spring:message code="mrNo"/>:<br/>
                                                                    <form:input path="mrNo" cssClass="userInputLarge"/></td>
                                                                <td><spring:message code="empId"/>:<br/>
                                                                    <form:input path="empId" cssClass="userInputLarge disableinput" readonly="true" /></td><br/>
                                                            <br><span id="errorsDiv_empId"></span>


                                                            </tr>
                                                            <tr>
                                                                <td><spring:message code="familyCode"/>:<br/><form:input path="familyCode" cssClass="userInputLarge"/></td>
                                                                <td>
                                                                    <spring:message code="eligible"/>:<br/>
                                                                    <form:radiobutton cssClass="gender" path="eligible" value="true" cssStyle="margin:0 -20px 0 0;" /><spring:message code="yes"/>&nbsp;
                                                                    <form:radiobutton cssClass="gender" path="eligible" value="false" cssStyle="margin:0 -20px 0 0;" /><spring:message code="no"/>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td><spring:message code="phone1"/>:<br/><form:input path="phone1" cssClass="userInputLarge" id="phone1" />
                                                                    <span id="errorsDiv_phone1"></span><br/>
                                                                </td>
                                                                <td><spring:message code="phone2"/>:<br/><form:input path="phone2" cssClass="userInputLarge"/></td> 
                                                            <span id="errorsDiv_phone2"></span><br/>
                                                            </tr>
                                                            <tr>
                                                                <td><spring:message code="emailId"/>:<br/><form:input  path="emailId"  class="userInputLarge"/><br/>
                                                                    <span id="errorsDiv_emailId"></span><br/>
                                                                </td>
                                                                <td><spring:message code="customerType"/>:<br/>
                                                                    <form:select  path="paymentTypeId.paymentTypeId"  id="paymentTypeId.paymentTypeId" cssClass="userInputMedium">
                                                                        <form:option value="" label="-"></form:option>
                                                                        <form:options items="${paymentTypeList}" itemLabel="paymentTypeName" itemValue="paymentTypeId"></form:options>
                                                                    </form:select><br/>
                                                                    <span id="errorsDiv_paymentTypeId.paymentTypeId"></span><br/>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td><spring:message code="dateOfBirth"/>:<br/>
                                                                    <input name="dateOfBirth1"  id="dateOfBirth1" value="${customer.dateOfBirth}" class="userInputLarge" />
                                                                </td>
                                                                <td><spring:message code="age"/>:<br/>
                                                                    <%--<form:input path="age" cssClass="userInputLarge"/> --%>
                                                                    <input type="text" readonly="true" name="age" id="age">
                                                                    <br><span id="errorsDiv_age"></span>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    <spring:message code="gender"/>:<br/>
                                                                    <form:select  path="gender"  cssClass="userInputMedium">
                                                                        <form:option value="" label="-"></form:option>
                                                                        <form:option value="Male" label="-">Male</form:option>
                                                                        <form:option value="Female" label="-">Female</form:option>
                                                                        <form:option value="U" label="-">U</form:option>
                                                                        <form:option value="Not Known" label="-">Not Known</form:option>
                                                                    </form:select><br/>
                                                                    <span id="errorsDiv_gender"></span><br/>
                                                                </td>
                                                                <td>
                                                                    <spring:message code="bloodGroup"/>:<br/>
                                                                    <form:select  path="bloodGroup"  cssClass="userInputMedium">
                                                                        <form:option value="" label="-"></form:option>
                                                                        <form:option value="A+" label="-">A+</form:option>
                                                                        <form:option value="A-" label="-">A-</form:option>
                                                                        <form:option value="B+" label="-">B+</form:option>
                                                                        <form:option value="B-" label="-">B-</form:option>
                                                                        <form:option value="AB+" label="-">AB+</form:option>
                                                                        <form:option value="AB-" label="-">AB-</form:option>
                                                                        <form:option value="O+" label="-">O+</form:option>
                                                                        <form:option value="O-" label="-">O-</form:option>
                                                                        <form:option value="Not Known" label="-">Not Known</form:option>
                                                                    </form:select><br/>
                                                                    <span id="errorsDiv_bloodGroup"></span><br/>
                                                                </td>

                                                            </tr>

                                                            <tr>
                                                                <td><spring:message code="relation"/>:<br/> <form:select  path="relation.relationId"  cssClass="userInputMedium">
                                                                        <form:option value="" label="-"></form:option>
                                                                        <form:options items="${relationList}" itemLabel="relationName" itemValue="relationId"></form:options>
                                                                    </form:select><br/>
                                                                    <span id="errorsDiv_relation.relationId"></span><br/>
                                                                </td>
                                                                <td>
                                                                    <spring:message code="noOfDependence"/>:<br/>
                                                                    <%--<form:input path="dependence" cssClass="userInputMedium"/> --%>
                                                                    <form:select  path="dependence" id="dependence" cssClass="userInputMedium">
                                                                        <form:option value="0" label="-">0</form:option>
                                                                        <form:option value="1" label="-">1</form:option>
                                                                        <form:option value="2" label="-">2</form:option>
                                                                        <form:option value="3" label="-">3</form:option>
                                                                        <form:option value="4" label="-">4</form:option>
                                                                        <form:option value="5" label="-">5</form:option>
                                                                        <form:option value="6" label="-">6</form:option>
                                                                        <form:option value="7" label="-">7</form:option>
                                                                        <form:option value="8" label="-">8</form:option>
                                                                        <form:option value="9" label="-">9</form:option>
                                                                        <form:option value="N/A" label="-">N/A</form:option>
                                                                    </form:select>
                                                                </td>

                                                            </tr>

                                                            <tr>
                                                                <td><spring:message code="dateOfJoining"/>:<br/>
                                                                    <input name="dateOfJoining1"  id="dateOfJoining1" value="${customer.dateOfJoining}" class="userInputLarge"/>
                                                                </td>
                                                                <td>
                                                                    <spring:message code="officeLocation"/>:<br/>

                                                                    <form:select  path="officeLocation.officeId" id="officeLocation.officeId" cssClass="userInputLarge">
                                                                        <form:option value="" label="-"></form:option>
                                                                        <form:options items="${officeList}" itemLabel="officeLocation" itemValue="officeId" ></form:options>
                                                                    </form:select><br/>
                                                                    <span id="errorsDiv_officeLocation.officeId"></span><br/>
                                                                </td>


                                                            </tr>

                                                            <tr>
                                                                <td><spring:message code="address1"/>:<br/><form:textarea path="address" cssClass="userInputLarge"/></td>
                                                                <td><spring:message code="address2"/>:<br/><form:textarea path="road" cssClass="userInputLarge"/></td>
                                                            </tr>
                                                            <tr>
                                                                <td><spring:message code="landmark"/>:<br/><form:input path="landmark" cssClass="userInputLarge"/></td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    <spring:message code="pinCode"/>:<br/>
                                                                    <form:input path="zipCodeArea.zipCode" cssClass="userInputMedium" onchange="showZipCode();" /><br/>
                                                                    <span id="errorsDiv_zipCodeArea.zipCode"></span><br/></td>

                                                            </tr>
                                                            <tr>
                                                                <td>Area :<br/>
                                                                    <input type="text" name="area" id="area" value="${customer.zipCodeArea.area}" class="userInputLargeReadOnly" readonly >
                                                                </td>
                                                                <td>MasterZone :<br/>
                                                                    <input type="text" name="masterZone" id="masterZone" value="${customer.zipCodeArea.masterZone.masterZoneCode}" class="userInputMediumReadOnly" readonly  >
                                                                </td>
                                                            </tr>

                                                            <tr>

                                                                <td><spring:message code="prefferdCenter"/>:<br/>
                                                                    <form:select  path="healthSpringCenter.centerId"  id="healthSpringCenter.centerId" cssClass="userInputMedium">
                                                                        <form:option value="" label="-"></form:option>
                                                                        <form:options items="${centerList}" itemLabel="centerName" itemValue="centerId"></form:options>
                                                                    </form:select><br/>
                                                                    <span id="errorsDiv_healthSpringCenter.centerId"></span><br/>
                                                                </td>
                                                                <td><spring:message code="registrationStatus"/>:<br/>
                                                                    <form:select  path="registrationStatus"  cssClass="userInputMedium">
                                                                        <form:option value="Not Started" label="-">Not Started</form:option>
                                                                        <form:option value="Pending" label="-">Pending</form:option>
                                                                        <form:option value="Completed" label="-">Completed</form:option>
                                                                    </form:select><br/>
                                                                </td>
                                                            </tr>

                                                            <tr>

                                                                <td>Customer Inputs:<br/> 
                                                                    <form:textarea path="notes" cssClass="userInputLarge" readonly="true"/><br/>
                                                                </td>
                                                            </tr>

                                                        </table>
                                                    </fieldset>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <fieldset>
                                                        <legend><spring:message code="knownAllergy"/></legend>
                                                        <table class="formTable1">

                                                            <tr>
                                                                <td><spring:message code="food"/>:<br/>
                                                                    <form:input path="food" cssClass="userInputLarge"/><br/>
                                                                    <span id="errorsDiv_food"></span>
                                                                </td> 
                                                                <td><spring:message code="drug"/>:<br/>
                                                                    <form:input path="drug" cssClass="userInputLarge"/><br/>
                                                                    <span id="errorsDiv_drug"></span>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td><spring:message code="other"/>:<br/>
                                                                    <form:textarea path="otherAllergies" cssClass="userInputLarge"/><br/>
                                                                    <span id="errorsDiv_otherAllergies"></span>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </fieldset>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <fieldset>
                                                        <legend><spring:message code="knownIllness"/></legend>
                                                        <table class="formTable1">
                                                            <tr>
                                                                <td>Available Illnesses :<br/> 
                                                                    <select name="left_out"  id="left_out" multiple size="10" style="width: 150px; margin: 0;"></select>
                                                                </td>
                                                                <td align="center" valign="center">
                                                                    <br/><br/><br/>
                                                                    <input type="button" value="<<" onClick="moveLeft();" name="leftButton" class="less_btn" />
                                                                    <br/><br/><br/>
                                                                    <input type="button" value=">>" onClick="moveRight();" name="rightButton" class="less_btn"/></td>
                                                                <td>Selected Illnesses :<br/>
                                                                    <select name="final_tiers" id="final_tiers"  multiple size="10" style="width: 150px; margin: 0;"></select>
                                                                    <span id="errorsDiv_final_tiers"></span></td>
                                                            </tr>  
                                                            <tr>

                                                                <td colspan="2"><spring:message code="otherIllness"/>:<br/>
                                                                    <form:textarea path="otherIllness" cssClass="userInputLarge"/><br/>
                                                                    <span id="errorsDiv_otherIllness"></span></td>
                                                                </td>

                                                            </tr> 
                                                        </table>
                                                    </fieldset>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <fieldset style="width: 100%;">
                                                        <legend><spring:message code="title.updateCustomer"/></legend>
                                                        <table class="formTable">
                                                            <tr>

                                                                <td><spring:message code="callType"/>:<br/>
                                                                    <form:select  path="callType.callTypeId"  cssClass="userInputLarge" onchange="showDispositionList();">
                                                                        <form:option value="" label="-" ></form:option>
                                                                        <form:options items="${callTypeList}" itemLabel="callTypeName" itemValue="callTypeId"></form:options>
                                                                    </form:select><br/>
                                                                    <span  id="errorsDiv_callType.callTypeId"></span><br/>
                                                                </td>
                                                                <td><spring:message code="disposition"/>:<br/>
                                                                    <form:select  path="disposition.dispositionId"  id="dispositionId" cssClass="userInputLarge">
                                                                        <form:option value="" label="-"></form:option>
                                                                        <form:options items="${dispositisdasdsonList}" itemLabel="dispositionName" itemValue="dispositionId"></form:options>
                                                                    </form:select><br/>
                                                                    <span  id="errorsDiv_dispositionId"></span><br/>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td><spring:message code="cheifComplaint"/>:<br/>
                                                                    <textarea name="transCheifComplaint" cssClass="userInputLarge"></textarea></td>
                                                                <td><spring:message code="notes"/>:<br/>
                                                                    <textarea name="transNotes" id="transNotes"></textarea><br/>
                                                                    <span id="errorsDiv_transNotes"></span></td>
                                                            </tr>
                                                            <tr>
                                                                <td><spring:message code="followupDate"/>:<br/>
                                                                    <input name="transFollowupDate" id="followupDate" value="${follwUpDate}" class="userInputLarge"/>
                                                                    <span id="errorsDiv_followupDate"></span><br/>
                                                                </td>
                                                                <td><spring:message code="status"/>:<br/>
                                                                    <form:select  path="status"  cssClass="userInputMedium">
                                                                        <form:option value="Open" label="-">Open</form:option>
                                                                        <form:option value="Closed" label="-">Closed</form:option>
                                                                    </form:select><br/>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td><spring:message code="doctorName"/>:<br/> 
                                                                    <form:select  path="doctor.doctorId"  cssClass="userInputLarge">
                                                                        <form:option value="0" label="-"></form:option>
                                                                        <form:options items="${doctorList}" itemLabel="doctorName" itemValue="doctorId"></form:options>
                                                                    </form:select><br/>
                                                                    <span id="errorsDiv_doctor.doctorId"></span><br/></td>
                                                                <td><spring:message code="callRecordingID"/>:<br/> 
                                                                    <input  name="recordingId" id="recordingId" class="userInputLarge"/><br/>
                                                                    <span id="errorsDiv_recordingId"></span>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    <p><label>Hospital Name:</label><br />
                                                                        <input type="text" name="hospitalId" id="hospitalId"  class="userInputLarge" onchange="test();" />
                                                                </td>
                                                                <td>
                                                                    <p><label>Exclusive Specialist Name:</label><br />
                                                                        <input type="text" name="appSpecialistId" id="appSpecialistId"  class="userInputLarge"  />
                                                                </td>
                                                            </tr>

                                                            <tr>
                                                                <td colspan="3">
                                                                    <input type="submit" name="_submit" id="_submit" style="float: left; margin: 0 20px 0 0;" value="<spring:message code="button.Update"/>" onclick="validateForm();return yav.performCheck('form1', rules, 'inline');" />
                                                                    <input type="submit" name="_submitAndSendSms" id="_submitAndSendSms"  style="float: left; margin: 0 20px 0 0;" value="Update And Send Sms" onclick="validateForm();return yav.performCheck('form1', rules, 'inline');"/>
                                                                    <input type="submit" name="_cancel" id="_cancel"  style="float: left; margin: 0 20px 0 0;" value="<spring:message code="button.Cancel"/>"/>
                                                                </td>
                                                                <%--                                                                <td>
                                                                                                                                    <input type="submit" name="_cancel" id="_cancel" value="<spring:message code="button.Cancel"/>"/>
                                                                                                                                </td>
                                                                                                                               <td>
                                                                                                                                    <input type="submit" name="_cancel" id="_cancel" value="<spring:message code="button.Cancel"/>"/>
                                                                                                                                </td> --%>
                                                            </tr>
                                                            <input type="hidden" name="selectedIllnessIds" id="selectedIllnessIds"/>
                                                            <script laguage="javascript">
                                                                var rightBox=document.form1.final_tiers;
                                                                var leftBox=document.form1.left_out;
                                                                <c:forEach items="${illnessListLeft}" var="parameter">
                                                                    addOption(leftBox,'${parameter.ILLNESS_NAME}','${parameter.iid}');
                                                                </c:forEach>
                                                                <c:forEach items="${illnessListRight}" var="parameter">
                                                                    addOption(rightBox,'${parameter.ILLNESS_NAME}','${parameter.ILLNESS_ID}');
                                                                </c:forEach>
                                                            </script>
                                                        </table>                                     

                                                    </fieldset>
                                                    <spring:hasBindErrors name="customer">
                                                        <div class="error">
                                                            <form:errors path="*"/>
                                                        </div>
                                                    </spring:hasBindErrors>
                                                </td>
                                            </tr>
                                        </table>
                                    </fieldset>

                                </form:form>
                            </div>
                        </td>

                        <td  style="width: 50%; vertical-align:top;">
                            <div class="update_customer_form1">
                                <fieldset style="width:95%; float: left; position: relative;">
                                    <legend>Customer history</legend>
                                    <div style="width:auto; height:410px; overflow:scroll;">
                                        <table class="customer_history">
                                            <c:set var="count" value="${fn:length(customerTrans)}"></c:set>
                                            <c:forEach items="${customerTrans}" var="item">
                                                <tr><td colspan="2" align="center" class="category_table"><b>Call No : ${count}</b></td></tr>
                                                <tr>
                                                    <td><br/></td>
                                                </tr>
                                                <tr>
                                                    <td width="125px"><b>Disposition :</b></td>
                                                    <td>${item.disposition.dispositionName}</td>
                                                </tr>
                                                <tr>
                                                    <td width="125px">Followup Date :</td>
                                                    <td>${item.followupDate}</td>
                                                </tr>
                                                <tr>
                                                    <td width="125px">Last Modified Date :</td>
                                                    <td><fmt:formatDate value="${item.lastModifiedDate}" pattern="dd-MM-yy HH:mm"/></td>
                                                </tr>
                                                <tr>
                                                    <td width="125px">Agent :</td>
                                                    <td>${item.lastModifiedBy.username}</td>
                                                </tr>
                                                <tr>
                                                    <td width="125px">Notes :</td>
                                                    <td>${item.notes}</td>
                                                </tr>
                                                <tr>
                                                    <td width="125px">Chief Complaint :</td>
                                                    <td>${item.cheifComplaint}</td>
                                                </tr>
                                                <tr>
                                                    <td width="125px">Call type :</td>
                                                    <td>${item.callType.callTypeName}</td>
                                                </tr>
                                                <tr>
                                                    <td width="125px">Status :</td>
                                                    <td>${item.transStatus}</td>
                                                </tr>
                                                <tr>
                                                    <td width="125px">Call Recording Id :</td>
                                                    <td>${item.recordingId}</td>
                                                </tr>
                                                <tr><td><br/></td></tr>
                                                        <c:set var="count" value="${count-1}"></c:set>
                                                    </c:forEach>
                                        </table>
                                    </div>
                                </fieldset>
                            </div>
                        </td>
                    </tr>
                </tbody>    
            </table>
        </div>
    </body>
</html>
